package day05;

import java.util.Arrays;
import java.util.Random;

public class Array {
    public static void main(String[] args) {
        /*Random rand = new Random();
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = rand.nextInt(100);
            ;
            System.out.println(arr[i]);
        }

*/
        /*int[] arr = {0, 1, 2, 3, 4, 5, 6};
        arr= Arrays.copyOf(arr, arr.length+1);
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }*/
        int[] arr = new int[10];
        Random rand = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = rand.nextInt(100);
            System.out.println(arr[i]);
        }
        Arrays.sort(arr);
        System.out.println(arr[arr.length-1]);

    }
}

